package com.yxb.appointment.service.impl;

import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yxb.appointment.mapper.MyAppointmentMapper;
import com.yxb.appointment.domain.MyAppointment;
import com.yxb.appointment.service.IMyAppointmentService;

/**
 * 我的预约Service业务层处理
 * 
 * @author 林德炫
 * @date 2025-03-29
 */
@Service
public class MyAppointmentServiceImpl implements IMyAppointmentService 
{
    @Autowired
    private MyAppointmentMapper myAppointmentMapper;

    /**
     * 查询我的预约
     * 
     * @param appointmentId 我的预约主键
     * @return 我的预约
     */
    @Override
    public MyAppointment selectMyAppointmentByAppointmentId(Long appointmentId)
    {
        return myAppointmentMapper.selectMyAppointmentByAppointmentId(appointmentId);
    }

    /**
     * 查询我的预约列表
     * 
     * @param myAppointment 我的预约
     * @return 我的预约
     */
    @Override
    public List<MyAppointment> selectMyAppointmentList(MyAppointment myAppointment)
    {
        return myAppointmentMapper.selectMyAppointmentList(myAppointment);
    }

    /**
     * 新增我的预约
     * 
     * @param myAppointment 我的预约
     * @return 结果
     */
    @Override
    public int insertMyAppointment(MyAppointment myAppointment)
    {
        return myAppointmentMapper.insertMyAppointment(myAppointment);
    }

    /**
     * 修改我的预约
     * 
     * @param myAppointment 我的预约
     * @return 结果
     */
    @Override
    public int updateMyAppointment(MyAppointment myAppointment)
    {
        return myAppointmentMapper.updateMyAppointment(myAppointment);
    }

    /**
     * 批量删除我的预约
     * 
     * @param appointmentIds 需要删除的我的预约主键
     * @return 结果
     */
    @Override
    public int deleteMyAppointmentByAppointmentIds(Long[] appointmentIds)
    {
        return myAppointmentMapper.deleteMyAppointmentByAppointmentIds(appointmentIds);
    }

    /**
     * 删除我的预约信息
     * 
     * @param appointmentId 我的预约主键
     * @return 结果
     */
    @Override
    public int deleteMyAppointmentByAppointmentId(Long appointmentId)
    {
        return myAppointmentMapper.deleteMyAppointmentByAppointmentId(appointmentId);
    }

    @Override
    public List<MyAppointment> getListByParentName(String parentName, String status) {
        return myAppointmentMapper.getListByParentName(parentName, status);
    }

    @Override
    public List<MyAppointment> getListByTeacherName(String teacherName, String status) {
        return myAppointmentMapper.getListByTeacherName(teacherName, status);
    }

    @Override
    public Boolean confirmAppointment(Long appointmentId) {
        return myAppointmentMapper.confirmAppointment(appointmentId);
    }
}
